package com.zlll.winner.service.advertising;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zlll.winner.business.model.advertising.AdvertisingDetail;
import com.zlll.winner.mapper.advertising.AdvertisingDetailMapper;
import com.zlll.winner.business.service.advertising.IAdvertisingDetailService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.dubbo.config.annotation.Service;

import java.util.List;

/**
 * <p>
 * 广告详情表 服务实现类
 * </p>
 *
 * @author qsx
 * @since 2019-09-07
 */
@Service
public class AdvertisingDetailServiceImpl extends ServiceImpl<AdvertisingDetailMapper, AdvertisingDetail> implements IAdvertisingDetailService {

    /**
     * 根据广告ID获取详情
     * @param id
     * @return
     */
    @Override
    public List<AdvertisingDetail> queryAdvertiseDetailByPublishId(Long id) {
        LambdaQueryWrapper<AdvertisingDetail> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(AdvertisingDetail::getIsDel, 0);
        wrapper.eq(AdvertisingDetail::getPublishId, id);
        return list(wrapper);
    }
}
